#include <game.h>
#include <test_c.h>
#include <stdio.h>
#include <program_manager.h>
#include <GLES2/gl2.h>
#include <string.h>

int Game::init()
{
	t3 = NULL;
	t3 = new Texture();	
	t3->load("../res/rockmanx.tga");
	

	sh1 = NULL;
	sh1 = new Shader();
	sh1->load("../res/texture.vs", GL_VERTEX_SHADER);	

	sh2 = NULL;
	sh2 = new Shader();
	sh2->load("../res/texture.fs", GL_FRAGMENT_SHADER);

	p1 = NULL;
	p1 = new Program();
	p1->load(sh1->getID(), sh2->getID());
	p1->addShaderIO("a_position", IO_TYPE_ATTRIBUTE);
	p1->addShaderIO("a_texCoord", IO_TYPE_ATTRIBUTE);
	p1->addShaderIO("s_baseMap", IO_TYPE_UNIFORM);
	p1->addShaderIO("s_lightMap", IO_TYPE_UNIFORM);

	PROGRAM_MANAGER->add("texture", p1);
	
	return 1;
}

void Game::draw()
{
	t3->setX(0.0f);
	t3->setY(0.0f);
	t3->draw();
}

void Game::destroy()
{
	delete t3;
	delete sh1;
	delete sh2;
	delete p1;
}
